package xworker.gluon.glisten.control;

import com.gluonhq.charm.glisten.control.ProgressIndicator;
import org.xmeta.ActionContext;
import org.xmeta.Thing;

public class ProgressIndicatorActions {
    public static void init(ProgressIndicator node, Thing thing, ActionContext actionContext) {
        ProgressIndicatorActions.init(node, thing, actionContext);

        if (thing.valueExists("radius")) {
            node.setRadius(thing.getDouble("radius"));
        }

    }

    public static ProgressIndicator create(ActionContext actionContext) {
        Thing self = actionContext.getObject("self");
        ProgressIndicator node = new ProgressIndicator();
        init(node, self, actionContext);

        actionContext.peek().put("parent", node);
        for (Thing child : self.getChilds()) {
            child.doAction("create", actionContext);
        }

        actionContext.g().put(self.getMetadata().getName(), node);
        return node;
    }

}